package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.MesPackageProductMapper;
import com.ruoyi.order.domain.MesPackageProduct;
import com.ruoyi.order.service.IMesPackageProductService;

/**
 * 产品装箱清单Service业务层处理
 * 
 * @author guoxl
 * @date 2025-08-05
 */
@Service
public class MesPackageProductServiceImpl implements IMesPackageProductService 
{
    @Autowired
    private MesPackageProductMapper mesPackageProductMapper;

    /**
     * 查询产品装箱清单
     * 
     * @param detailId 产品装箱清单主键
     * @return 产品装箱清单
     */
    @Override
    public MesPackageProduct selectMesPackageProductByDetailId(Long detailId)
    {
        return mesPackageProductMapper.selectMesPackageProductByDetailId(detailId);
    }

    /**
     * 查询产品装箱清单列表
     * 
     * @param mesPackageProduct 产品装箱清单
     * @return 产品装箱清单
     */
    @Override
    public List<MesPackageProduct> selectMesPackageProductList(MesPackageProduct mesPackageProduct)
    {
        return mesPackageProductMapper.selectMesPackageProductList(mesPackageProduct);
    }

    @Override
    public List<MesPackageProduct> selectListByPackCode(String packCode) {
        return mesPackageProductMapper.selectListByParkCode(packCode);
    }

    /**
     * 新增产品装箱清单
     * 
     * @param mesPackageProduct 产品装箱清单
     * @return 结果
     */
    @Override
    public int insertMesPackageProduct(MesPackageProduct mesPackageProduct)
    {
        mesPackageProduct.setCreateTime(DateUtils.getNowDate());
        return mesPackageProductMapper.insertMesPackageProduct(mesPackageProduct);
    }

    /**
     * 修改产品装箱清单
     * 
     * @param mesPackageProduct 产品装箱清单
     * @return 结果
     */
    @Override
    public int updateMesPackageProduct(MesPackageProduct mesPackageProduct)
    {
        mesPackageProduct.setUpdateTime(DateUtils.getNowDate());
        return mesPackageProductMapper.updateMesPackageProduct(mesPackageProduct);
    }

    /**
     * 批量删除产品装箱清单
     * 
     * @param detailIds 需要删除的产品装箱清单主键
     * @return 结果
     */
    @Override
    public int deleteMesPackageProductByDetailIds(Long[] detailIds)
    {
        return mesPackageProductMapper.deleteMesPackageProductByDetailIds(detailIds);
    }

    /**
     * 删除产品装箱清单信息
     * 
     * @param detailId 产品装箱清单主键
     * @return 结果
     */
    @Override
    public int deleteMesPackageProductByDetailId(Long detailId)
    {
        return mesPackageProductMapper.deleteMesPackageProductByDetailId(detailId);
    }

    @Override
    public int deleteMesPackageProductByPackCode(String packCode) {
        return mesPackageProductMapper.deleteMesPackageProductByPackCode(packCode);
    }
}
